
import Vue from 'vue'
import App from './App'
import router from './router'


import Vuex from 'vuex'

Vue.use(Vuex);

Vue.config.productionTip = false


let store = new Vuex.Store({
  //数据
  state: {
    num: 30
  },
  //取数据
  getters:{
    getMun(state){
      return state.num
    }
  },
  //操作数据
  mutations: {
    addNum(state,payload){
      state.num += payload.num ;//调用者传递增加数量
    }
  }
})


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
